package gui.bottombar;

import javax.swing.JPanel;

/**This is the controller of the bottom bar of this system: it controls updating 
 * display information on the bottom bar, such as showing messages, showing user
 * name. 
 * */
public class BottomBarController {
	
	// the base panel of the bottom bar 
	private static BottomBar bottombar = null;
	
	/**

	 * */
	public static JPanel getComponent(){
		if( bottombar == null )
			init();
		
		return bottombar;
	}
	
	
	/**
	 * Display the given message on the left of the bottom bar; this message usually
	 * is a important system message or welcome message.
	 * 
	 * @param	msg	The message programmer wants to display on the left of the 
	 * bottom bar. 
	 * 
	 * */
	public static void setMessage(String msg){
		bottombar.setMessage( msg );
	}
	
	
	/** Create a JPannel of the bottom bar if it hasn't been initialized yet. */
	private static void init(){
		if( bottombar == null ){
			bottombar = new BottomBar();
		}
	}
}
